<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use DB;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
	
	
	/*
	* 	操作提示 
	* 	参数：$show_info 你应该输入的内容
	* 		  $url 		 接下来要跳转到哪
	*	登录比较特殊	 参数为两个
	*/
	public function show_msg( $show_info='',$url='' ){
		$return = array();
		$return['show_info']=$show_info;
		$return['url']=$url;
		exit( json_encode( $return ) );
	}
	
	
	/*
	* 	查询前台用户名称
	* 	参数：$user_id 用户id
	*/
	public function getUserName( $user_id='' ){
		// 只返回一条数据
		$user_info = DB::table('user')
						->where( 'id','=',$user_id )
						->first();
		return $user_info;
	}
	
	
	
	
}
